package com.rc.saas.tenant.common.base;

import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * BaseMapper
 * @param <K> Key
 * @param <E> Entity
 * @param <X> EntityExample
 */
public interface BaseMapper<K, E, X> {
    long countByExample(X example);

    int deleteByExample(X example);

    int deleteByPrimaryKey(K id);

    int insert(E record);

    int insertSelective(E record);

    List<E> selectByExample(X example);

    List<E> selectByEecord(E record);

    E selectByPrimaryKey(K id);

    int updateByExampleSelective(@Param("record") E record, @Param("example") X example);

    int updateByExample(@Param("record") E record, @Param("example") X example);

    int updateByPrimaryKeySelective(E record);

    int updateByPrimaryKey(E record);
}